const express = require('express')
const router = express.Router()
const checkLogin = require('../middlewares/checklogin')

router.use(checkLogin)

router.get('/',(req,res)=>{
    if(req.session.logined && req.session.loginUser){
        res.render('index',{user:req.session.loginUser})
    }else{
        res.render('index',{user:null})
    }
})


module.exports = router